package com.learn.sb.sblearnshardingjdbc.pojo;

import lombok.Data;

/**
 * 分库+分表
 * 以 user_id 分库，以 order_id 分表
 */
@Data
public class Order {
	private Integer id;
	private Integer orderId;
	private Integer userId;
	private String status;
}

/**
 CREATE TABLE `t_order_0` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `order_id`  int NOT NULL ,
 `user_id`  int NOT NULL ,
 `status`  varchar(32) NOT NULL ,
 PRIMARY KEY (`id`)
 );
 CREATE TABLE `t_order_1` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `order_id`  int NOT NULL ,
 `user_id`  int NOT NULL ,
 `status`  varchar(32) NOT NULL ,
 PRIMARY KEY (`id`)
 );
 */